﻿using System;
using System.Windows.Controls;
using System.Windows.Media.Animation;

namespace MyoSharp.HackNighter.Controls
{
    public partial class PlayerUC : UserControl
    {
        public event EventHandler OnDie;

        public PlayerUC()
        {
            InitializeComponent();
        }

        #region Methods

        public void Die()
        {
            var storyboard = (Storyboard)this.Resources["DieStoryboard"];
            storyboard.Completed += (s, e) =>
            {
                if (null != OnDie)
                    OnDie(this, EventArgs.Empty);
            };
            storyboard.Begin();
        }

        #endregion Methods
    }
}